<template>
    <view class="bodys">
        <u-toast ref="uToast"></u-toast>
        <view class="justCotain">
            <view class="justCell">
                <u-row justify="space-between" gutter="12" @click="goEditPwd()">
                    <u-col span="10">
                        <view class="">修改登录密码</view>
                    </u-col>
                    <u-col span="1">
                        <u-icon name="arrow-right" color="#999" size="18"></u-icon>
                    </u-col>
                </u-row>
            </view>
            <view class="justCell">
                <u-row justify="space-between" gutter="12">
                    <u-col span="9">
                        <view class="">版本信息</view>
                    </u-col>
                    <u-col span="2" style="display: flex;">
                        <view class="">
                            V1.0.5
                        </view>
                    </u-col>
                </u-row>
            </view>
            <view class="justCell" @click="logOut()">
                <u-row justify="space-between" gutter="12">
                    <u-col span="10">
                        <view class="">注销账号</view>
                    </u-col>
                    <u-col span="1">
                        <u-icon name="arrow-right" color="#999" size="18"></u-icon>
                    </u-col>
                </u-row>
            </view>

            <u-modal :show="showModal" title="温馨提示" @cancel="showModal = false" showCancelButton confirmText="确认"
                @confirm="confirm">
                <view class="slot-content">
                    <text style="text-align: center;">是否确认注销？</text>
                </view>
            </u-modal>

        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                showModal: false,
            }
        },
        methods: {
            goEditPwd() {
                uni.navigateTo({
                    url: '/pages/login/editPwd'
                });

            },
            confirm() {
                this.showModal = false
                this.$refs.uToast.show({
                    message: '已注销，请重新注册后在登录',
                    complete() {
                        uni.navigateTo({
                            url: '/pages/login/login'

                        })
                    }
                })
                uni.removeStorageSync('TOKEN_KEY')

            },
            logOut() {
                this.showModal = true
            }
        }
    }
</script>

<style lang="scss" scoped>
    .bodys {
        background-color: #f7f8fa;
        min-height: 100%;
        width: 100%;

        .justCotain {
            border-radius: 12rpx;
            float: left;
            background-color: #fff;
            margin-top: 20rpx;
            width: 100%;

            .justCell {
                width: 97%;
                margin-left: 3%;
                height: 95rpx;
                line-height: 95rpx;
                border-bottom: 1px solid #f8f8f8;
            }

            &:active {
                background: #f2f2f2;
            }

            &:last-child {
                border-bottom: none !important;
            }
        }
    }
</style>